package com.smart.milvus.bean;

import com.smart.milvus.conditions.query.BaseQueryWrapper;
import com.smart.milvus.conditions.search.BaseSearchWrapper;
import com.smart.milvus.exception.MilvusException;
import com.smart.milvus.model.Page;
import io.milvus.client.MilvusClient;
import io.milvus.grpc.LoadState;

import java.util.List;

public interface BaseMilvusMapper<T extends MilvusModel<? extends MilvusModel<?>>> {
    MilvusClientService getMilvusClientService();

    MilvusClient getMilvusClient();

    boolean insert(T vectorModel) throws MilvusException;

    boolean remove(Object pk) throws MilvusException;

    boolean batchRemove(BaseQueryWrapper<T, ? extends BaseQueryWrapper<T, ?>> wrapper) throws MilvusException;

    void loadCollection() throws MilvusException;

    LoadState getLoadState() throws MilvusException;

    Long getLoadProgress() throws MilvusException;

    void releaseCollection() throws MilvusException;

    boolean hasCollection() throws MilvusException;

    List<T> search(BaseSearchWrapper<T, ?, ? extends BaseSearchWrapper<T, ?, ?>> wrapper) throws MilvusException;

    List<T> query(BaseQueryWrapper<T, ? extends BaseQueryWrapper<T, ?>> wrapper) throws MilvusException;

    Page<T> queryPage(BaseQueryWrapper<T, ? extends BaseQueryWrapper<T, ?>> wrapper, Long page, Long pageSize) throws MilvusException;
}
